import pymysql as pmq


def connect(ip, user, password, dbname):
    con = pmq.connect(ip, user, password, dbname)
    # 操作游标
    return con

def commit():
    # 提交到数据库 -------ps：不写这一行无法插入
    connection.commit()